#pragma once
#include "../sgp/DirectDrawFwd.h"
#include "../sgp/Rect.h"

namespace ja2{ namespace sgp
{
	//! Mouse cursor background.
	class MouseCursorBackground : boost::noncopyable
	{
		// Constants
	public:
		//! Max cursor width.
		static unsigned short const MAX_CURSOR_WIDTH = 64;
		//! Max cursor height.
		static unsigned short const MAX_CURSOR_HEIGHT = 64;

		// Attributes
	private:
		//! Should cursor be restored.
		bool m_Restore;
		//! mouse x position.
		std::uint16_t m_MouseXPos;
		//! mouse y position.
		std::uint16_t m_MouseYPos;
		//! Left.
		std::uint16_t m_Left;
		//! Top.
		std::uint16_t m_Top;
		//! Right.
		std::uint16_t m_Right;
		//! Bottom.
		std::uint16_t m_Bottom;
		//! Region.
		Rect m_Region;
		//! Surface.
		IDirectDrawSurfacePtr m_pSurface;

		// Operations
	public:
		//! Should mouse be restored.
		bool restore() const;
		//! Blit cursor on surface.
		void blit(IDirectDrawSurfacePtr &pBuffer);
		//! Update data.
		void update(MouseCursorBackground const &Copy);


		// Construction/Destruction
	public:
		MouseCursorBackground(IDirectDraw7 *pDirectDraw);
	};

	typedef std::unique_ptr<MouseCursorBackground> MouseCursorBackgroundPtr_t;
} /*sgp*/} /*ja2*/
